package hjslm.Service.Impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import framework.base.common.Pager;
import hjslm.Bean.WeixinBean;
import hjslm.DAO.IWeixinDAO;
import hjslm.Service.IWeixinService;

@Service
public class WeinxinServiceImpl implements IWeixinService{
	@Autowired
	IWeixinDAO dao;
	
	@Override
	public WeixinBean selectOne(WeixinBean bean) {
		return dao.selectOne(bean);
	}

	@Override
	public List<WeixinBean> selectList(WeixinBean bean) {
		return dao.selectList(bean);
	}

	@Override
	public int update(WeixinBean bean) {
		return dao.update(bean);
	}

	@Override
	public int insert(WeixinBean bean) {
		return dao.insert(bean);
	}

	@Override
	public int delete(WeixinBean bean) {
		return dao.delete(bean);
	}

	//分页查询功能
	@Override
	public Pager<WeixinBean> selectPage(WeixinBean bean, Pager<WeixinBean> pager) {
		return dao.selectPage(bean, pager);
	}

	@Override
	public Map<String, String> selectMap() {
		List<WeixinBean> list = dao.selectList(null);
		Map<String, String> map = new HashMap<String, String>();
		for (WeixinBean weixinBean : list) {
			map.put(weixinBean.getName(),weixinBean.getContent());
		}
		return map;
	}
	

}
